import { createApp } from "vue";
import App from "./App.vue";
import router from "./router/index";
import store from "./store/index";
import axios from "./http/requst";
import "element-plus/dist/index.css";
import ElementPlus from "element-plus";
import zhCn from "element-plus/es/locale/lang/zh-cn";

import "./assets/style/index.less"; // global css
import "./assets/style/public.less"; // global css
//引入全局组件方法
import btn from "@/components/public/btn.vue";
import btnPlain from "@/components/public/btnPlain.vue";
import { NoticeBar, Swipe, SwipeItem } from "vant";

import $ from "jquery";
import "./assets/icon/iconfont.css";
import converData from "./utils/converData";
import ruleCheck from "./utils/ruleCheck";
import city from "./utils/city";
import getCate from "./utils/getCate";
// import VConsole from "vconsole";
// const vConsole = new VConsole();

import less from "less";
import "vant/lib/index.css";
const app = createApp(App);

app.use(ElementPlus, {
  locale: zhCn, // 一定要加上，不然无效
});
app.use(less);
app.use(NoticeBar);
app.use(Swipe);
app.use(SwipeItem);
app.component("btn", btn);
app.component("btnPlain", btnPlain);

app.config.globalProperties.$ = $;
app.config.globalProperties.$converData = converData;
app.config.globalProperties.$getCate = getCate;
app.config.globalProperties.$city = city;
app.config.globalProperties.$ruleCheck = ruleCheck;
app.config.globalProperties.$apis = "https://www.whalenav.cn";
app.config.globalProperties.$docHeight = document.documentElement.clientHeight;
app.config.globalProperties.$docWidth = document.documentElement.clientWidth;
app.config.globalProperties.$axios = axios;
app.use(router).use(ElementPlus).use(store).mount("#app");
